package com.cdhospital.adminservice;

import com.cdhospital.Model.Expert;
import com.jfinal.plugin.activerecord.Page;

public class ExpertService {

	private static final Expert dao=new Expert().dao();
	
	
	public Page<Expert> paginate(int pageNumber, int pageSize,int id) {
		return dao.paginate(pageNumber, pageSize, "select expert.*, department.*", "from  expert ,department where expert.department = department.did and department.did=?",id);
	}
	public Page<Expert> paginates(int pageNumber, int pageSize) {
		return dao.paginate(pageNumber, pageSize, "select expert.*, department.*", "from department, expert where expert.department = department.did ");
	}
	public Expert findById(int id) {
		return dao.findById(id);
	}
	public  boolean deleteById(int id) {
		boolean flag=dao.deleteById(id);
		return flag;
	}
}
